package com.nononsenseapps.feeder.util

import timber.log.Timber
import java.util.*

inline fun  Boolean?.isTrue(t: () -> Unit) {
    if (this != null && this )
        t()
}



inline fun runTimes(name:String=UUID.randomUUID().toString(), f: () -> Unit){
    Timber.d("run fun:$name\t start ...")
    val startTime=System.currentTimeMillis()
    f()
    Timber.d("run fun:$name\t end.... \trun time count:${System.currentTimeMillis()-startTime} ")
}